<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/10/16
  Time: 16:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
</head>

<body>
<div class="page-bar">
    <ul class="page-num-ul clearfix">
        <li>共${param.totalcount}条记录&nbsp;&nbsp; ${param.pageNo}/${param.totalPage}页</li>
        <a href="javascript:page_nav(document.forms[0],1)">首页</a>
        <a href="javascript:page_nav(document.forms[0],${param.pageNo-1<1?1:param.pageNo-1})">上一页</a>&nbsp;&nbsp;
        <a href="javascript:page_nav(document.forms[0],${(param.pageNo+1)>param.totalPage?param.totalPage:(param.pageNo+1)})">下一页</a>
        <a href="javascript:page_nav(document.forms[0],${param.totalPage})">最后一页</a>&nbsp;&nbsp;
    </ul>
    <span class="page-go-form"><label>跳转至</label>
                 <input type="text" name="inputPage" id="inputPage" class="page-key">页
                 <button type="button" class="page-btn" onclick="jump_to(document.forms[0],document.getElementById('inputPage').value,${param.totalPage})">GO</button>
    </span>
</div>
</body>
</html>

<script>
    function page_nav(frm,pageNo) {
        frm.pageNo.value=pageNo;
        frm.submit();
    }

    function  jump_to(frm,pageNo,totalPage){
        if(!isNaN(pageNo)){
            if(pageNo>totalPage){
                alert("页码输入有误不能大于总页数");
                return;
            }
            frm.pageNo.value=pageNo;
            frm.submit();

        }
    }
</script>